#pragma once

class CEditBox;

class CEditor
{
public:
	CEditor(void);
	~CEditor(void);

	HRESULT Init(HWND hWnd, LPDIRECT3DDEVICE9 pDevice);

	HRESULT Update();
	HRESULT Render();

	LRESULT MsgProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );

protected:
	HRESULT RenderPanel(const RECT& rc, D3DCOLOR color, bool bShadow = true);
	HRESULT DrawMessageList();

	void InsertMsgType(const char* msg);

private:
	ID3DXFont* m_pFont;
	ID3DXLine* m_pLine;

	float m_fCurrentTime;
	float m_fLastTime;
	float m_fAccumTime;
	float m_fElapsedTime;

	CEditBox* m_pEditBox;
	RECT m_rcInput;
	RECT m_rcOutput;
	RECT m_rcInspector;

	typedef std::vector<std::string> MessageConainter;
	typedef MessageConainter::iterator MsgItor;
	MessageConainter m_vecSystemMsg;
};
